<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>addWeekDays</title>
</head>

<body>
    <div>打开浏览器控制台查看结果</div>
    <script>
        const addWeekDays = (startDate, count) =>
            Array.from({ length: count }).reduce(date => {
                date = new Date(date.setDate(date.getDate() + 1));
                if (date.getDay() % 6 === 0) {
                    date = new Date(date.setDate(date.getDate() + (date.getDay() / 6 + 1)));
                }
                return date;
            }, startDate);
        console.log(addWeekDays(new Date('Oct 09, 2020'), 5)); // 'Oct 16, 2020'
        console.log(addWeekDays(new Date('Oct 12, 2020'), 5)); // 'Oct 19, 2020'
    </script>
</body>

</html>